1. Field of the Invention
The present invention relates to the fields of distributed computing systems, client-server computing and object oriented programming. Specifically, the present invention is a method and apparatus for providing client programs the ability to communicate and use references to objects such that the full benefit of software caching are obtained on each machine where the objects are used.
2. Background
In an object oriented system, an object is a component comprising data and operations which can be invoked to manipulate the data. The operations are invoked on the object by sending calls to the object. Each object has an object type. The object type defines the operations that can be performed on objects of that type. The object operations are implemented independent of the objects themselves. Additionally, one object type may inherit the object operations defined and implemented for other object types. For further description of object oriented design and programming techniques see "Object-oriented Software Construction" by Bertrand Meyer, Prentice-Hall 1988.
In client-server computing, typically there is a set of computers that can communicate with one another through a network connecting the computers. Some of these computers act as providers of services or functions to other computers. The providers of such service or functionality are known as "servers", and the consumers of such service or functionality are called "clients". The client-server model also generalizes to the case where distinct programs running on the same computer are communicating with one another through some protected mechanism and are acting as providers and consumers of functionality.
In object oriented distributed systems based upon the client-server model, there exist servers that provide object oriented interfaces to their clients. These servers support objects consisting of data and the associated software. Clients may obtain access to these objects and may execute calls on them. These calls are transmitted to the server from the client. At the server these calls are executed via the software associated with the object. The results of these calls are then transmitted back to the client.
Client programs reference particular objects by means of object handles. An "object handle" is an identifier which provides a way of locating an object (the "target object") and of executing calls on it. Client programs are typically given object handles by another program or by the operating system kernel at program initiation. If a given client program has an object handle referencing a particular object then that client program can pass a copy of that object handle to another client program. The second client program can then use the object handle to access the object.
Object handles are implemented in a variety of ways. For example, one known system uses object handles consisting of two components. Component A is the network address of the server, and component B is an identifier of the target object relative to that server. When an object invocation is performed, the client sends the object invocation to the network address specified by component A and also transmits the identifier specified by component B. The server then uses component B to identify the particular object that is being invoked. Another system, the Emerald system, also uses an object handle that consists of two components. The first, called an "object identifier", is an integer value that acts as a unique identifier for the object. The second component, called the "forwarding address", contains a hint about the network address where the object currently resides. When an Emerald client wishes to communicate with the object it must determine the current network address of that object. See "Fine-Grained Mobility in the Emerald System", by Eric Jul, Henry Levy, Norman Hutchinson and Andrew Black, ACM Transactions on Computer Systems, 6(1) 1988, pp. 109-133. Other systems use various other formats for object handles. These object handles shall be characterized herein as "simple object handles" and their variety of formats is irrelevant to the present invention as more fully described below.
These "simple object handles" are not adequate to allow a distributed system to take full advantage of software caching. "Software Caches" are used in many operating systems to improve system performance. For example, file Caching is implemented by retaining in main memory a few of the most recently accessed disk blocks. File Caching has been implemented on servers, providing data five to ten times faster than similar data fetched from the disk. Software caching provides similar efficiencies in distributed systems. Using the caching technique, the client does not communicate directly with the server but rather with a cache manager program which is typically running on his machine. The cache manager will attempt to maintain some internal state that reflects part of the state of the server so that the cache manager can respond to client requests without always needing to communicate with the server. This technique reduces the time for the client's operations to be performed while also reducing the number of operations that must be performed by the server.
Such software caching can be implemented in an object oriented distributed system, where the caching is implemented using objects. However, due to the limitations of the "simple object handles", the benefits of caching at the client machine level are obviated in certain situations. For example, whenever a client program running on one machine, passes the "simple object handle" to another client program which is running on a different machine, a problem develops. This problem is explained more fully in the detailed description of the present invention below. However, generally, the problem arises because the object handle which the first program was using was actually a pointer to a cache manager on the first program's machine rather than a pointer to the target object itself. Thus when the first program passes "its" object handle to a program on another machine, the receiving program has no present way of knowing where the object handle is pointing. And in this situation, an inefficiency occurs because the receiving program's invocation of an operation on the target object results, not in a call to a cache manager on the receiving program's machine or on the server containing the target object, but rather results in a call on the cache manager in the machine of the program that sent the object handle to the receiving program. This unfortunate situation negates the benefits of local machine caching completely. The present invention solves this problem by having the sending program give the receiving program an additional reference to the target object.
Accordingly, the present invention provides an apparatus and a method comprising an augmented object handle (in the preferred embodiment called the "Extended Cachable Handle") which will provide the ability for a client to automatically select a cache manager running on its own machine (if any), and if its machine has several different cache managers specializing in caching different kinds of objects, the Extended Cachable Handle will permit the automatic selection of a cache manager based upon the actual characteristics of the target object. If no local cache manager is available, the receiving program has the ability to access the target object directly, without reference to the transmitting program's machine.